<?php
namespace Seeds\Admin\Auth;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use App\Models\Admin\Auth\User;

class UserSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // 超级管理员
        $user = User::firstOrCreate([
            'email' => 'admin@admin.com'
        ], [
            'name' => 'Super Admin',
            'password' => Hash::make('admin@admin.com'),
            'email_verified_at' => now()
        ]);
        // 分配角色
        $user->assignSuperAdmin();

        // 生成多条随机数据
        // factory(\App\Models\Admin\Auth\User::class, 50)->create();
    }
}
